package com.zzy.hero.service.impl;

import com.zzy.hero.entity.Hero;
import com.zzy.hero.mapper.HeroMapper;
import com.zzy.hero.service.HeroService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author 邹靓仔
 * @date 2020/6/10 -22:40 -hero-zzy
 **/
@Service
@Transactional
public class HeroServiceImpl implements HeroService {

    @Autowired
    private HeroMapper heroMapper;



    @Override
    public int add(Hero hero) {
        return heroMapper.add(hero);
    }

    @Override
    public int delete(int id) {
        return heroMapper.delete(id);
    }

    @Override
    public int update(Hero hero) {
        return heroMapper.update(hero);
    }

    @Override
    public List<Hero> selectList() {
        return heroMapper.selectList();
    }

    @Override
    public Hero findHeroById(int id) {
        return heroMapper.findHeroById(id);
    }
}
